POZOR: Na začetku 2. celice spreminjamo iposn in nasred 3. celice Ime outputa!!!!!!!

Clear["Global`*"];
MapaH5="c:\\Users\\gal\\Documents\\DRUGI PROGRAMI\\Wolfram Mathematica\\saška ura\\data iz posnetkov\\";
fps=240;
tzf=5;(*točk levo in desno za fitanje parabole*)
RedGlDef=5;(*default*)
RedGlMax=20;


ImenaH5=FileNames[{"*TNjimSIM.h5"},MapaH5,{2}];
zjiji=Import[#,{"Data",1}]&/@ImenaH5;

iposn=5;
zji=zjiji[[iposn]];
Clear[a,b,IFitOd,IFitDo];



Manipulate[

IFO=IFitOd;
IFD=IFitDo;
{A,B}={a,b}/.FindFit[
	zji[[IFitOd;;IFitDo]],a x+b,{a,b},x
];
B-=A IFitOd;
ListLinePlot[
{
	zji,
	A Range@Length@zji+B, 
	{{IFitOd,zji[[IFitOd]]},{IFitDo,zji[[IFitDo]]}}
},
Joined -> {True,True,False},
PlotStyle -> {Automatic,Automatic, PointSize[.010]}
],


{{IFitOd,1},1,Length@zji},(*Round@((Length@zji)/2)*)
{{IFitDo,Length@zji},2,Length@zji}

]

ImeEks0=StringJoin@Riffle[Join[
	StringSplit[ImenaH5[[iposn]],"\\"][[;;-2]],
	{"VspZ0ji01SIM.h5"}   (*00 za nihajni del, 01, za prvi naklon, 02 za drugi*)
],"\\"];
Export[ImeEks0,{A,B,IFO,IFD}];